﻿using System;

namespace SystemDiagramNew.SystemDiagramLegend.DataDefine
{
	public class LegendGroup
	{
		public LegendGroup(LegendGroup orig)
		{
			this.TheName = orig.TheName;
			this.TheLegendKind = orig.TheLegendKind;
			this.LeftLink = orig.LeftLink;
			this.RightLink = orig.RightLink;
			this.TopLink = orig.TopLink;
			this.BottomLink = orig.BottomLink;
		}

		public LegendGroup(string name, LegendKind legendKind, Legend leftLink, Legend rightLink, Legend topLink, Legend bottomLink)
		{
			this.TheName = name;
			this.TheLegendKind = legendKind;
			this.LeftLink = leftLink;
			this.RightLink = rightLink;
			this.TopLink = topLink;
			this.BottomLink = bottomLink;
		}

		public string TheName { get; set; }

		public LegendKind TheLegendKind { get; private set; }

		public Legend LeftLink { get; private set; }

		public Legend RightLink { get; private set; }

		public Legend TopLink { get; private set; }

		public Legend BottomLink { get; private set; }

		internal Legend GetLegend(LegendDirection legendDirection)
		{
			switch (legendDirection)
			{
			case LegendDirection.LeftLink:
				return this.LeftLink;
			case LegendDirection.TopLink:
				return this.TopLink;
			case LegendDirection.RightLink:
				return this.RightLink;
			default:
				return this.BottomLink;
			}
		}
	}
}
